import md5 from "md5";
const KEY = 'ahkjHASdhKJsdh12k1j2jk12h3j1'//密钥 后端给的加入签名中(可能你的接口不需要)

export const stamp = () => Math.round(new Date().getTime() / 1000)//时间戳

export const autograph = (val: string = '', isKey: boolean = true, isStamp: boolean = true) => {
    const ctx = isKey ? `${KEY}${val}` : val
    const date = isStamp ? stamp() : ''
    return md5(md5(ctx) + date)
}//加密的封装
